#include<stdlib.h>
#include<curses.h>
#include "./lanes.h"


void drawLanesEasy(int laneSpeed, WINDOW *wnd)		//draws moving lanes, speed Depends on laneSpeed varible
{

	  int   maxcol,
                maxrow,
                row=0,
                col=0,
                rowTemp;

        getmaxyx(wnd, maxrow, maxcol);		//Gets the size of the window
	col = maxcol/4.0;		//set where the first colum starts
        while(TRUE)
        {
                if (row >= maxrow)	
                {
                        row = rowTemp;
                        rowTemp-= 2;
                        if (rowTemp >= maxrow)
                        {
                                rowTemp = 0;
                        }

                }

                mvprintw(row, col, "|\n \n");	//lane pattern
                mvprintw(row, col+8, "|\n \n");	//lane pattern
                mvprintw(row, col+16, "|\n \n");	//lane patternr
                mvprintw(row, col+24, "|\n \n");	//lane pattern
                row +=3;
                refresh();
		usleep(laneSpeed);		//lane speed
        }

}
void drawLanesMedium(int laneSpeed, WINDOW *wnd)           //draws moving lanes, speed Depends on laneSpeed varible
{

          int   maxcol,
                maxrow,
                row=0,
                col=0,
                rowTemp;

        getmaxyx(wnd, maxrow, maxcol);          //Gets the size of the window
	col = maxcol/4.0;		//set where the first colum starts
        while(TRUE)
        {
                if (row >= maxrow)
                {
                        row = rowTemp;
                        rowTemp-= 2;
                        if (rowTemp >= maxrow)
                        {
                                rowTemp = 0;
                        }

                }

                mvprintw(row, col, "|\n \n");   //lane pattern
                mvprintw(row, col+8, "|\n \n"); //lane pattern
                mvprintw(row, col+16, "|\n \n");        //lane patternr
                mvprintw(row, col+24, "|\n \n");        //lane patterns
                mvprintw(row, col+32, "|\n \n");        //lane pattern
                row +=3;
                refresh();
                usleep(laneSpeed);              //lane speed
        }

}
void drawLanesHard(int laneSpeed, WINDOW *wnd)           //draws moving lanes, speed Depends on laneSpeed varible
{

          int   maxcol,
                maxrow,
                row=0,
                col=0,
                rowTemp;

        getmaxyx(wnd, maxrow, maxcol);          //Gets the size of the window
	col = maxcol/4.0;		//set where the first colum starts
        while(TRUE)
        {
                if (row >= maxrow)
                {
                        row = rowTemp;
                        rowTemp-= 2;
                        if (rowTemp >= maxrow)
                        {
                                rowTemp = 0;
                        }

                }

                mvprintw(row, col, "|\n \n");   //lane pattern
                mvprintw(row, col+8, "|\n \n"); //lane pattern
                mvprintw(row, col+16, "|\n \n");        //lane patternr
                mvprintw(row, col+24, "|\n \n");        //lane pattern
                mvprintw(row, col+32, "|\n \n");        //lane pattern
                mvprintw(row, col+40, "|\n \n");        //lane pattern
                row +=3;
                refresh();
                usleep(laneSpeed);              //lane speed
        }

}
